<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <!-- 避免IE使用兼容模式 -->
    <meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta name="renderer" content="webkit">
    <!-- TopJUI框架样式 -->
    <link type="text/css" href="/static/topjui/themes/default/topjui.core.min.css" rel="stylesheet">
    <link type="text/css" href="/static/topjui/themes/default/topjui.blue.css" rel="stylesheet" id="dynamicTheme"/>
    <!-- FontAwesome字体图标 -->
    <link type="text/css" href="/static/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet"/>
    <!-- layui框架样式 -->
    <link type="text/css" href="/static/plugins/layui/css/layui.css" rel="stylesheet"/>
    <!-- jQuery相关引用 -->
    <script type="text/javascript" src="/static/plugins/jquery/jquery.min.js"></script>
    <script type="text/javascript" src="/static/plugins/jquery/jquery.cookie.js"></script>
    <!-- TopJUI框架配置 -->
    <script type="text/javascript" src="/static/public/js/topjui.config.js"></script>
    <!-- TopJUI框架核心-->
    <script type="text/javascript" src="/static/topjui/js/topjui.core.min.js"></script>
    <!-- TopJUI中文支持 -->
    <script type="text/javascript" src="/static/topjui/js/locale/topjui.lang.zh_CN.js"></script>
    <!-- layui框架js -->
    <script type="text/javascript" src="/static/plugins/layui/layui.js" charset="utf-8"></script>
</head>

<body>
<table data-toggle="topjui-treegrid"
       data-options="id:'menuTg',
        idField:'id',
        treeField:'text',
        url:'/sResc/menuD',
        expandUrl:'/sResc/menuD?menuId={id}',
        fitColumns:true">
    <thead>
    <tr>
        <th data-options="field:'uuid',title:'UUID',checkbox:true"></th>
        <th data-options="field:'text',title:'名称',width:200"></th>
        <th data-options="field:'url',title:'资源地址',width:100"></th>
        <th data-options="field:'id',title:'编号',width:100"></th>
        <th data-options="field:'pid',title:'父级编号',width:100"></th>
        <th data-options="field:'sort',title:'排序',width:50"></th>
        <th data-options="field:'iconCls',title:'资源图标',width:100"></th>
        <th data-options="field:'state',title:'资源类别',width:100,hidden:true"></th>
        <th data-options="field:'stateText',title:'资源类别',width:100"></th>
    </tr>
    </thead>
</table>

<!-- 表格工具栏开始 -->
<div id="menuTg-toolbar" class="topjui-toolbar"
     data-options="grid:{
           type:'treegrid',
           id:'menuTg',
           parentIdField:'pid'
       }">
    <a href="javascript:void(0)"
       data-toggle="topjui-menubutton"
       data-options="method:'expandAll',
       extend: '#menuTg-toolbar',
       btnCls:'topjui-btn-blue'">展开全部</a>
    <a href="javascript:void(0)"
       data-toggle="topjui-menubutton"
       data-options="method:'collapseAll',
       extend: '#menuTg-toolbar',
       btnCls:'topjui-btn-blue'">折叠全部</a>

    <a href="javascript:void(0)"
       data-toggle="topjui-menubutton"
       data-options="method:'openDialog',
       extend: '#menuTg-toolbar',
       iconCls: 'fa fa-plus',
       btnCls: 'topjui-btn-blue',
       dialog:{
           id:'sRescAddDialog',
           href:'/sResc/add',
           buttonsGroup:[
               {text:'保存',url:'/sResc/save?flag=add',iconCls:'fa fa-plus',handler:'ajaxForm',btnCls:'topjui-btn-brown'}
           ]
       }">新增</a>
    <a href="javascript:void(0)"
       data-toggle="topjui-menubutton"
       data-options="method: 'openDialog',
            extend: '#menuTg-toolbar',
            iconCls: 'fa fa-pencil',
            btnCls: 'topjui-btn-green',
            dialog: {
                width: 950,
                height: 500,
                href: '/sResc/edit',
                url: '/sResc/detail?menuId={id}',
                buttonsGroup: [
                    {
                        text: '更新',
                        url: '/sResc/save?flag=edit',
                        iconCls: 'fa fa-save',
                        handler: 'ajaxForm',
                        btnCls: 'topjui-btn-green'
                    }
                ]
            }">编辑</a>
    <a href="javascript:void(0)"
       data-toggle="topjui-menubutton"
       data-options="method:'doAjax',
       extend: '#menuTg-toolbar',
       btnCls:'topjui-btn-brown',
       iconCls:'fa fa-trash',
       url:'/sResc/delete',
       grid: {uncheckedMsg:'请先勾选要删除的数据',param:'rescCde:id'}">删除</a>
</div>
<!-- 表格工具栏结束 -->

</body>
</html>